package cn.mccraft.uide.api.project;

import java.util.Collection;
import java.util.Set;

import javax.annotation.Nonnull;

import cn.mccraft.uide.api.project.dependency.DependencyContainer;
import cn.mccraft.uide.api.element.Element;
import cn.mccraft.uide.api.plugin.extension.ElementProvider;
import cn.mccraft.uide.api.plugin.extension.ProjectProvider;

public interface ProjectManager {
	
	<P extends Project> void register(ProjectProvider<P> provider);
	
	<P extends Project> void unregister(ProjectProvider<P> provider);
	
	<P extends Project> void unregister(Class<P> clazz);
	
	Collection<Class<?>> registedProjects();
	
	<P extends Project> boolean isRegistedFor(Class<P> clazz);
	
	<P extends Project> Set<DependencyContainer> getDependencies(Class<P> clazz);
	
	<P extends Project> void addDependency(@Nonnull Class<P> clazz, @Nonnull DependencyContainer container);
	
	<P extends Project> void removeDependency(@Nonnull Class<P> clazz, @Nonnull DependencyContainer container);
	
	<P extends Project> Set<Class<?>> getElements(Class<P> clazz);
	
	<P extends Project, E extends Element> void addElement(@Nonnull Class<P> clazz, @Nonnull ElementProvider<E> provider);
	
	<P extends Project, E extends Element> void removeElement(@Nonnull Class<P> clazz, @Nonnull ElementProvider<E> provider);
	
	<P extends Project, E extends Element> void removeElement(@Nonnull Class<P> clazz, @Nonnull Class<E> elementClazz);

}
